package com.example.jobback.service.common;

import com.example.jobback.po.User;
import com.example.jobback.req.common.password.ResetPasswordReq;
import com.example.jobback.req.common.phone.ResetPhoneReq;
import com.example.jobback.result.Result;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * @InterfaceName: CommonService
 * @Description: 通用服务接口
 * @Author: lhb
 * @Date: 2025/5/14
 */
@Service
public interface UserCommonService {
     boolean verifyCode(String phone, String code) throws Exception;
     <T> String setRedisUser(T user,Long userId,String keyPrefix, String jwtSecret,Long ttl, TimeUnit timeUnit);
     String uploadAvatar(Long userId,MultipartFile file,String catalog);


     User registerUser(String phoneAes);

     int updateUserAvatar(Long userId, String lastUrl);

     int editBasicMessage(User user);


     boolean deleteAllLoginKeys(Long userId);

     User getUserByPhoneAes(String phoneAes);


     String updateRedisUserToken(Long userId,String keyPrefix, String jwtSecret,Long ttl, TimeUnit timeUnit);

    User getUserByUserId(Long userId);

     boolean authUserPassword(Long userId, String passwordAes);

     int registerUserAuth(Long userId, String passwordAes);

    Long getAllUserNum();

    List<User> getUsersByName(String content);

    List<User> getUsersByUserIds(List<Long> userIds);

    int updateUserAuth(Long userId, String passwordAes);

    Result<Object> resetPassword(ResetPasswordReq resetPasswordReq, String phoneAesDataBase, Long userId);

    Result<Object> resetPhone(ResetPhoneReq resetPhoneReq, String phoneAesDataBase, Long userId);
}
